from . import property, update, preferences, keymap
from .. import ui, rsc, ops, test

mod_tuple = (
    # 单个文件 .py
    keymap,
    update,
    property,

    # 模块 __init__.py
    test,

    ui,
    rsc,
    ops,
    preferences,
)


def change():
    preferences.Preferences.pref_.cache_clear()


def register():
    for mod in mod_tuple:
        mod.register()
    change()
    preferences.Preferences.preload_icons()


def unregister():
    for mod in mod_tuple[::-1]:
        mod.unregister()
    change()
